import http from '@/api/request.js'

export default function () {
  return {
    // 获取路由信息
    getRouterList: (data) => {
      return http.post('/backend/admin/router/list', data)
    },
    // 添加路由
    createRouter: (data) => {
      return http.post('/backend/admin/router/create', data)
    },
    // 更新路由
    updateRouter: (data) => {
      return http.post('/backend/admin/router/update', data)
    },
    // 删除路由
    deleteRouter: (data) => {
      return http.post('/backend/admin/router/delete', {
        id: data
      })
    },
    //更改路由状态
    updateRouterStatus: (data) => {
      return http.post('/backend/admin/router/enable', data)
    },
    // 获取路由树
    treeDataList: (data) => {
      return http.post('/backend/admin/router/get-tree', data)
    }
  }
}
